######################################################
# 参考[1] 《Storing Battery Fuel Gauge Parameters in DS2780》
# https://www.maximintegrated.com/cn/app-notes/index.mvp/id/3584
# 给出的计算公式得到

global AccBias_mA    # 偏执电流mA
global SensoR_mohm # 20mΩ

global AgingCapacity_mAhrs
global ChargeVoltage_mV 
global ChargeCurrent_mA

global AEVoltage_mV 
global AECurrent_uA 

global ActiveEmpty_40_mAhrs

global Full_40_mAhrs
global Full_30_mAhrs
global Full_20_mAhrs
global Full_10_mAhrs
global Full_00_mAhrs

global AE_40_mAhrs
global AE_30_mAhrs
global AE_20_mAhrs
global AE_10_mAhrs
global AE_00_mAhrs


global SE_40_mAhrs
global SE_30_mAhrs
global SE_20_mAhrs
global SE_10_mAhrs
global SE_00_mAhrs

global RSGAIN
global RSTCO 


AccBias_mA=0.3125    # 偏执电流mA
SensoR_mohm = 20 # 20mΩ

AgingCapacity_mAhrs=1001.25
ChargeVoltage_mV = 4157.8# 充电电压mV
ChargeCurrent_mA=80

AEVoltage_mV = 3689.3
AECurrent_mA = 240

ActiveEmpty_40_mAhrs=6

Full_40_mAhrs=1015
Full_30_mAhrs=1005
Full_20_mAhrs=991
Full_10_mAhrs=954
Full_00_mAhrs=909

AE_40_mAhrs=6
AE_30_mAhrs=10
AE_20_mAhrs=18
AE_10_mAhrs=31
AE_00_mAhrs=60


SE_40_mAhrs=0# 无用
SE_30_mAhrs=2
SE_20_mAhrs=5
SE_10_mAhrs=10
SE_00_mAhrs=27

RSGAIN=1.03
RSTCO = 0